function f_exit()
{   #退出时清理临时文件
    declare file_count
    {
        [ -f "${sql_exe_error}" ] && rm -f "${sql_exe_error}"
        [ -S "${gh_socket_file}" -o -f "${gh_socket_file}" ] && rm -f "${gh_socket_file}"
        [ -f "${alter_file_tmp}" ] && rm -f "${alter_file_tmp}"
        [ -f "${alter_file_tmp1}" ] && rm -f "${alter_file_tmp1}"
        [ -f "${alter_file_tmp2}" -a "${execute}x" == "1x" ] && rm -f "${alter_file_tmp2}"
        [ -f "${alter_file_tmp2}" -a "${1}x" == "1x" ] && rm -f "${alter_file_tmp2}"
        [ -f "${alter_file_tmp3}" ] && rm -f "${alter_file_tmp3}"
        [ -f "${res_file}" ] && rm -f "${res_file}"
        [ -f "${max_thread_file}" ] && rm -f "${max_thread_file}"
        [ -f "${has_mdl_lock_file}" ] && rm -f "${has_mdl_lock_file}"
        [ -f "${bug_mark_file}" ] && rm -f "${bug_mark_file}"
        [ -f "${has_max_process_file}" ] && chattr -i ${has_max_process_file} && rm -f "${has_max_process_file}"
        if [ -n "${test_mysql_comm}" ]
        then
            if [ "${1}x" == "1x" ] || [ "${execute_opt}x" == "0x" ] || [ "${execute}x" == "1x" ]
            then
                timeout ${exe_time} ${test_mysql_comm} -NBe "drop database if exists ${test_db_exe};drop database if exists ${test_db};" >/dev/null 2>&1 || true
            fi
        fi
        #针对rename操作, 会生成old_table和new_table的文件
        for ((file_count=0; file_count<=${#osc_run_mark_file_list[@]}; file_count++))
        do
            if [ -f "${osc_run_mark_file_list[${file_count}]}" ]
            then
                chattr -i ${osc_run_mark_file_list[${file_count}]} && rm -f ${osc_run_mark_file_list[${file_count}]}
            fi
        done
        [ -f "${res_log}.back" ] && rm -f "${res_log}.back"
        [ -f "${pause_file_name}" ] && rm -f "${pause_file_name}"
        [ -f "${check_mdl_mark_file}" ] && rm -f "${check_mdl_mark_file}"
        [ -f "${check_connect_file}" ] && rm -f "${check_connect_file}"
        [ -f "${check_thread_file}" ] && rm -f "${check_thread_file}"
        for ((file_count=0; file_count<=${#script_queue_file_list[@]}; file_count++))
        do
            [ -f "${script_queue_file_list[${file_count}]}" ] && rm -f ${script_queue_file_list[${file_count}]}
        done
    } || true
    [ "${1}x" == "-1x" ] && return 0
    __="delete from ${t_state_task} where order_id = ${user_order_id} and port = ${mysql_port};" #清理库里的临时记录
    [ "$(grep -ic "^alter_table" <<< "${mode_opt}")x" == "1x" ] && f_exe_sql_to_dbadb "${__}" "f_exit" || true
    [ "${1}x" == "1x" ] && exit 1
    [ "${1}x" == "0x" ] && exit 0
    return 0
}


